Visualizing and Maintaining the Green Canopy of NYC
Mini Project #03
Author
Karen Cruz
Published
November 10, 2025
The Incredible Environmental Benefits of NYC Trees | Craig. D.J. (2023)
Introduction
Greenery is a city quality that will always be cherished among urban cities, especially in New York City, where we are surrounded by a jungle of concrete. Not only is it visually pleasing, but it is also home to many species, provides better air quality, and brings together the community. By obtaining data from NYC TreeMap dataset, we are able to get insight on any major issues relating to this urban jungle.
Data Acquisition
NYC City Council Districts
In order to obtain information about trees in each council, we must download data about NYC’s 51 council districts and its boundaries.
NoteTask 1: Download NYC Council District Boundaries
Manhattan has a great variety of tree species, however, the most common was Gleditsia triacanthos var. inermis - Thornless honeylocust, with 16,846 trees in total.
5. What is the species of the tree closest to Baruch’s campus?
The closest tree near Baruch College is a Pyrus calleryana - Callery pear.
Government Project Design
NoteTask 5: NYC Parks Proposal
Proposal to NYC Park’s Department
As a NYC council member, I would like to request the NYC Park Department additional funding for our next project dealing with the improvement of trees in critical condition. These trees are extremely close to the end of their life, therefore we hope to identify their underlying issue to restore them to their best condition.
Rather than focusing solely on the district with the highest amount of trees in critical condition, working on trees based on critical fraction is our goal. We will act with urgency to tackle the district with the highest percentage and then share information about our approach to other districts with high numbers as well.
Although there is a total of fewer trees compared to other districts, the critical fraction is relatively high, signaling that its tree population may be in danger.
ggplot(critical_condition_comparison, aes(x =reorder(CounDist, critical_fraction), y = critical_fraction*100)) +geom_col(fill ="red") +coord_flip() +labs(title ="Top 5 NYC City Council Districts by Fraction of Critical Trees",x ="Council District",y ="Fraction of Trees in Critical Condition",caption ="Data: NYC OpenData" ) +theme_minimal(base_size =8) +geom_text(aes(label =paste0(round(critical_fraction*100,1), "%")), hjust =-0.1, size =5) +scale_y_continuous(limits =c(0, max(critical_condition_comparison$critical_fraction*100)*1.2))
Compared to District 9, District 10 shows a higher density of trees in critical condition, which is what this project hopes to target. We can see where the concentration truly is and which areas we should target first in case its causing any problems.
Code
library(patchwork) districts_9_10 <- nyc_council |>filter(CounDist %in%c(9, 10))trees_9_10 <- tree_with_district |>filter(CounDist %in%c(9, 10)) |>mutate(critical_flag =ifelse(tpcondition =="Critical", "Critical", "Other"))plot_heatmap <-function(district_number){ district <- districts_9_10 |>filter(CounDist == district_number) trees <- trees_9_10 |>filter(CounDist == district_number, critical_flag =="Critical") |>mutate(lon =st_coordinates(geometry)[,1],lat =st_coordinates(geometry)[,2])ggplot() +geom_sf(data = district, fill =NA, color ="black", size =0.5) +stat_density_2d(data = trees,aes(x = lon, y = lat, fill = ..level.., alpha = ..level..),geom ="polygon",contour =TRUE ) +scale_fill_gradient(low ="green", high ="red") +scale_alpha(range =c(0.1, 0.5), guide ="none") +labs(title =NULL,fill ="Density" ) +theme_minimal(base_size =12) +theme(axis.title =element_blank(),axis.text =element_blank(),axis.ticks =element_blank() )}p9 <-plot_heatmap(9) +theme(legend.position ="none")p10 <-plot_heatmap(10)combined_plot <- p9 + p10 +plot_annotation(title ="Highest Concentration of Critical Trees",caption ="Left: District 9 | Right: District 10" )combined_plot
To conclude, District 10 needs immediate assistance to treat these trees to improve everything and everyone’s quality of life. This project will not only protect those trees for the future, but protect everyone from its dangers in the present.